/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package control.khachhang;

import com.toedter.calendar.JDateChooser;
import java.util.Date;
import java.util.List;
import java.util.Vector;
import javax.swing.ButtonGroup;
import javax.swing.JRadioButton;
import javax.swing.JTable;
import javax.swing.JTextField;
import model.dao.khachhang.KhachHangDAO;
import model.entity.KhachHang;

/**
 *
 * @author Admin
 */
public class KHThem_Full_ctrl {
     /**
     * 
     */
    public static final void themKhachHang(JTable table, JTextField tfHo,JTextField tfTen,ButtonGroup gGioiTinh,
                                            JTextField tfSDT,JDateChooser jdateNgaySinh,JTextField tfDiaChi, JTextField tfGhiChu){
        String ho = tfHo.getText();
        String ten = tfTen.getText();
        
        int a = gGioiTinh.getButtonCount();
        String gioiTinh = gGioiTinh.getSelection().getActionCommand();
        System.out.println(gioiTinh);
        
        String soDT = tfSDT.getText();
        Date ngaySinh = jdateNgaySinh.getDate();
        String diaChi = tfDiaChi.getText();
        String ghiChu = tfGhiChu.getText();
        
        boolean kh = KhachHangDAO.themKhachHang(ho, ten, gioiTinh, ngaySinh, soDT, diaChi, ghiChu);
        List<KhachHang>list = KhachHangDAO.loaddAllKhachHang();
        KHMainPanel_ctrl.loadKhachHangLenTable(list, table);
       
        
       
    }
    
}
